//File:			E_Resource.h
//Purpose:		Prevent loading of resources already available in memory - handle loading and unloading of assets.
//Programmer:	Daniel Martin 4/21/2013

#pragma once
#include <iostream>
#include <map>
#include <list>
#include "Model.h"
#include "Collada.h"
#include "BaseEntity.h"

namespace Path
{
	const char Root[] = "Root";
	const char Data[] = "Data";
	const char Config[] = "Config";
	const char Models[] = "Models";
	const char Shaders[] = "Shaders";
	const char Materials[] = "Materials";
	const char Sound[] = "Sound";
}

class Resource
{
public:
	static std::map<std::string,Model> Models;
	static std::map<std::string,GLuint> Textures;

	static std::map<std::string,GLuint> Shaders;
	static std::map<std::string,GLuint> Shader_Programs;

	static std::list<Prop_Static>		DrawList;

	static Node Config;

	Resource(void);
	~Resource(void);

	static Model* LoadModel(std::string Path);
	static GLuint LoadTexture(std::string Path);
	static GLuint LoadShader(std::string FilePath, GLenum ShaderType);
	static GLuint LoadShader_Program(std::string VertexFile, std::string FragmentFile);
	static Node   LoadConfig(std::string FileName);



	// FileSystem
	static std::map<std::string,std::string> Keys;

	// Get the root, setup FileSystem defaults [Read from config file?]
	static void	Setup_FileSystem(char* Root);

	static std::string	AliasGet(std::string Alias); 
	static std::string	AliasAdd(std::string Alias,std::string Path);
	static void	AliasCreate(std::string Alias,std::string Path); // Make a new alias

	//FileSystem Utility
	static std::string	DirFix(std::string Dir);				// Fix the backslash characters.
	static bool	File_Exists(std::string Alias,std::string FileName);
	static bool	File_Exists(std::string Path);
	static bool	File_Load(std::string Path,std::string &Buffer );


};


